package cn.e4j.modular.api.util;

import cn.e4j.config.properties.E4jProperties;
import cn.e4j.core.reqres.response.ErrorResponseData;
import cn.e4j.core.reqres.response.ResponseData;
import cn.e4j.core.reqres.response.SuccessResponseData;
import cn.e4j.core.util.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;

import java.lang.reflect.Method;

/**
 * Controller通用类
 * @author caijy
 * @description
 * @datetime 2019-9-10 0010 16:00
 * @return
 */
public class ControllerSupport {
    public static ResponseData ERROR = new ErrorResponseData("服务器开小差了");
    public static ResponseData SUCCESS = new SuccessResponseData();

    public static ResponseData SUCCESS(Object obj){
        return new SuccessResponseData(obj);
    }

    public static ResponseData ERROR(Integer code,String msg){
        return new ErrorResponseData(code,msg);
    }

    public static ResponseData ERROR(String msg){
        return new ErrorResponseData(msg);
    }

}
